﻿using System;
using System.Collections.Generic;

namespace CommonEngine.Resource
{
    /// <summary>
    /// 数据权限，范围数据节点响应
    /// </summary>
    [Serializable]
    public class DataPermissionResponse
    {
        public string Error { get; set; }

        public string DisplayName { get; set; }

        /// <summary>
        /// 针对当前登录用户显示全部范围数据
        /// </summary>
        public bool DisplayIsAll { get; set; }

        /// <summary>
        /// 针对编辑用户显示全部范围数据
        /// </summary>
        public bool IsAll { get; set; }

        /// <summary>
        /// 范围数据
        /// </summary>
        public List<DataPermissionValueNode> DataPermissionValueNodeList { get; set; }
    }

    /// <summary>
    /// 数据权限，范围数据键值节点
    /// </summary>
    [Serializable]
    public class DataPermissionValueNode
    {
        public string Name { get; set; }

        public string Value { get; set; }

        /// <summary>
        /// 可以被选择
        /// </summary>
        public bool CanBeSelected { get; set; }

        /// <summary>
        /// 选中状态
        /// </summary>
        public bool IsSelected { get; set; }

        public List<DataPermissionValueNode> Children { get; set; }
    }
}
